class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.y: A = None
        self.t: E = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.s: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
a = B("a")
m = C("m")
g = D("g")
d = E("d")
f = F("f")
n = A("n")

c.x = n
c.y = n
c.o = f
c.w = f
c.v = f
c.t = d
a.u = g
m.v = f
m.o = f
m.z = a
m.s = g
g.q = m
g.r = a
g.v = a
d.s = m
f.w = a
f.y = a
f.s = n
n.x = c
n.y = c
n.o = f
n.w = f
n.v = f
n.t = d
assert a.u.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.y: A = None
        self.t: E = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.s: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

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

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

c = A("c")
a = B("a")
m = C("m")
g = D("g")
d = E("d")
f = F("f")
n = A("n")

c.x = n
c.y = n
c.o = f
c.w = f
c.v = f
c.t = d
a.u = g
m.v = f
m.o = f
m.z = a
m.s = g
g.q = m
g.r = a
g.v = a
d.s = m
f.w = a
f.y = a
f.s = n
n.x = c
n.y = c
n.o = f
n.w = f
n.v = f
n.t = d
assert a.u.q.s.txt == "g"