class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.u: E = None
        self.w: A = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.y: G = None
        self.p: G = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: F = None
        self.y: G = None
        self.p: G = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: G = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: A = None
        self.v: E = None
        self.txt = txt

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

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

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