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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: G = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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