class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: D = None
        self.t: C = None
        self.x: C = None
        self.o: E = None
        self.v: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: C = None
        self.p: C = None
        self.r: E = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

g = A("g")
f = B("f")
h = C("h")
b = D("b")
c = E("c")
j = F("j")

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: C = None
        self.p: C = None
        self.r: E = None
        self.y: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.v: B = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: A = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

g = A("g")
f = B("f")
h = C("h")
b = D("b")
c = E("c")
j = F("j")

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