class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.p: A = None
        self.z: E = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: G = None
        self.q: E = None
        self.s: G = None
        self.v: G = None
        self.y: D = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.z: B = None
        self.p: C = None
        self.txt = txt

b = A("b")
d = B("d")
i = C("i")
g = D("g")
f = E("f")
n = F("n")
j = G("j")
h = A("h")

b.x = g
b.u = g
b.p = h
b.z = f
b.y = n
b.q = i
d.t = n
d.v = g
i.w = f
i.q = f
i.u = j
i.s = j
i.v = j
i.y = g
i.x = g
g.w = j
g.r = f
f.w = i
f.t = g
n.z = j
n.u = j
n.s = f
j.q = h
j.s = i
j.p = i
j.z = d
h.x = g
h.u = g
h.p = b
h.z = f
h.y = n
h.q = i
assert d.t.u.s.w.t.r.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.u: D = None
        self.p: A = None
        self.z: E = None
        self.y: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: G = None
        self.q: E = None
        self.s: G = None
        self.v: G = None
        self.y: D = None
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.u: G = None
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: C = None
        self.z: B = None
        self.p: C = None
        self.txt = txt

b = A("b")
d = B("d")
i = C("i")
g = D("g")
f = E("f")
n = F("n")
j = G("j")
h = A("h")

b.x = g
b.u = g
b.p = h
b.z = f
b.y = n
b.q = i
d.t = n
d.v = g
i.w = f
i.q = f
i.u = j
i.s = j
i.v = j
i.y = g
i.x = g
g.w = j
g.r = f
f.w = i
f.t = g
n.z = j
n.u = j
n.s = f
j.q = h
j.s = i
j.p = i
j.z = d
h.x = g
h.u = g
h.p = b
h.z = f
h.y = n
h.q = i
assert d.t.u.s.w.t.r.w.s.txt == "j"