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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
n = C("n")
k = D("k")
c = E("c")
h = F("h")
j = G("j")

f.t = n
f.u = j
a.z = h
a.o = h
a.s = h
a.u = j
n.q = j
k.s = j
k.w = c
c.t = f
h.r = c
h.v = c
h.z = c
h.w = f
j.r = h
j.u = h
assert c.t.u.u.r.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

f = A("f")
a = B("a")
n = C("n")
k = D("k")
c = E("c")
h = F("h")
j = G("j")

f.t = n
f.u = j
a.z = h
a.o = h
a.s = h
a.u = j
n.q = j
k.s = j
k.w = c
c.t = f
h.r = c
h.v = c
h.z = c
h.w = f
j.r = h
j.u = h
assert c.t.u.u.r.t.u.txt == "j"