class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

k = A("k")
c = B("c")
d = C("d")
e = D("e")
j = E("j")
f = F("f")
b = G("b")

k.x = b
k.r = f
k.s = j
c.t = j
c.x = j
c.y = j
c.s = e
d.p = f
d.t = e
e.u = j
e.p = b
j.y = k
f.q = b
f.t = c
f.s = e
f.z = e
b.r = j
b.y = k
b.q = k
b.t = e
assert j.y.s.y.x.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: F = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.x: E = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.y: A = None
        self.q: A = None
        self.t: D = None
        self.txt = txt

k = A("k")
c = B("c")
d = C("d")
e = D("e")
j = E("j")
f = F("f")
b = G("b")

k.x = b
k.r = f
k.s = j
c.t = j
c.x = j
c.y = j
c.s = e
d.p = f
d.t = e
e.u = j
e.p = b
j.y = k
f.q = b
f.t = c
f.s = e
f.z = e
b.r = j
b.y = k
b.q = k
b.t = e
assert j.y.s.y.x.r.txt == "j"