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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: B = None
        self.y: G = None
        self.u: G = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.txt = txt

e = A("e")
b = B("b")
k = C("k")
g = D("g")
f = E("f")
m = F("m")
i = G("i")
d = C("d")

e.u = k
b.v = g
b.w = i
b.t = i
b.o = e
b.r = e
b.u = f
b.x = m
k.y = b
k.u = m
g.x = f
g.q = b
g.p = b
g.y = i
g.u = i
g.r = d
f.w = e
m.y = b
i.t = m
i.v = b
d.y = b
d.u = m
assert e.u.u.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: B = None
        self.y: G = None
        self.u: G = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: B = None
        self.txt = txt

e = A("e")
b = B("b")
k = C("k")
g = D("g")
f = E("f")
m = F("m")
i = G("i")
d = C("d")

e.u = k
b.v = g
b.w = i
b.t = i
b.o = e
b.r = e
b.u = f
b.x = m
k.y = b
k.u = m
g.x = f
g.q = b
g.p = b
g.y = i
g.u = i
g.r = d
f.w = e
m.y = b
i.t = m
i.v = b
d.y = b
d.u = m
assert e.u.u.y.txt == "b"