class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.v: F = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

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

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

b = A("b")
k = B("k")
c = C("c")
m = D("m")
g = E("g")
l = F("l")

b.u = l
b.v = l
b.y = c
b.q = m
b.x = m
k.r = m
k.y = m
c.s = l
c.w = m
c.y = g
c.p = g
m.o = g
m.q = g
m.w = l
m.z = b
m.u = k
g.u = c
l.r = b
l.q = b
l.v = c
assert b.x.u.y.w.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: C = None
        self.v: F = None
        self.q: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

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

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

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

b = A("b")
k = B("k")
c = C("c")
m = D("m")
g = E("g")
l = F("l")

b.u = l
b.v = l
b.y = c
b.q = m
b.x = m
k.r = m
k.y = m
c.s = l
c.w = m
c.y = g
c.p = g
m.o = g
m.q = g
m.w = l
m.z = b
m.u = k
g.u = c
l.r = b
l.q = b
l.v = c
assert b.x.u.y.w.r.y.txt == "c"